<script setup>
import { useRouter, useRoute } from "vue-router";
import Tabbar from "@/components/TabBar.vue";
const router = useRouter();
const route = useRoute();
const go = () => {
  router.push("/search")
}
const onClickLeft = () => {
  router.go(-1);
}
</script>

<template>
  <div class="app-container">

    <van-sticky :offset-top="0" v-if="route.meta.navBar">
      <van-nav-bar left-arrow @click-left="onClickLeft">
        <template #right>
          <van-icon name="search" size="18" @click="go" />
        </template>
        <template #title>
          {{ route.meta.title }}
        </template>
      </van-nav-bar>
    </van-sticky>

    <div class="layout-content">
      <router-view></router-view>
      <div style="height: 3rem;"></div>
    </div>

    <div class="layout-footer">
      <Tabbar />
    </div>
  </div>

</template>

<style scoped></style>
